<#import "/common/taglibs/spring.ftl" as spring/>
<#macro showGlobalErrors commandName separator="<br />">
    <#if commandName??>
        <@spring.bind path=commandName />
        <#assign errors = spring.status.errors/>
        <#if errors.hasGlobalErrors()>
            <div class="m-alert m-alert--icon alert alert-danger" role="alert">
                <div class="m-alert__icon">
                    <i class="la la-warning"></i>
                </div>
                <div class="m-alert__text">
                    <@spring.message code="form.validate.error"/><br/>
                    <#list errors.globalErrors as error>
                    ${error_index+1}. <@spring.messageArgsText code=error.code! args=error.arguments![] text=error.defaultMessage! />
                        <#if error_has_next>${separator}</#if>
                    </#list>
                </div>
                <div class="m-alert__close">
                    <button type="button" class="close" data-close="alert" aria-label="Close">
                    </button>
                </div>
            </div>
        </#if>
    </#if>
</#macro>